package service.calculator.bonchon.baguio;

import java.math.BigDecimal;
import java.util.List;

import models.Deduction;
import models.Payment;
import models.Rate;
import service.CalculationResult;
import service.calculator.bonchon.BonchonPaymentType;
import service.calculator.bonchon.BonchonPayrollCalculatorImpl;
import util.Rounder;

public class BonchonBaguioPayrollCalculatorImpl extends
		BonchonPayrollCalculatorImpl implements BonchonBaguioPayrollCalculator {

	public BigDecimal calculatePayment(Rate rate, Payment payment) {
		BigDecimal paymentCalculation = null;
        BonchonPaymentType paymentType = BonchonPaymentType
                .valueOf(payment.paymentType);
        BigDecimal paymentHrs = BigDecimal.valueOf(payment.hours);

        switch (paymentType) {
        case ECOLA:
        	paymentCalculation = BigDecimal.valueOf(2.50).multiply(paymentHrs);
        	paymentCalculation = Rounder.roundup(paymentCalculation);
        	break;
        default:
        	paymentCalculation = super.calculatePayment(rate, payment);
        }

		return paymentCalculation;
	}

}
